/*!
 * \file StateBase.h
 * \brief Base class for all generator states
 */

#ifndef STATE_BASE_H
#define STATE_BASE_H

#include <cstring>
#include "EventData.h"

namespace tsc
{
namespace common
{

class Generator;

/**
 * Base class for all generator states
 */
class StateBase
{
public:
	/**
	 * Returns the name of state
	 * \return name of state
	 */
	const char* getName() const;

	/**
	 * Handle specified event for the specified generator.
	 * It should be overridden by subclasses - preferably by the base class
	 * for states for specific protocol.
	 *
	 * \param generator the generator for which the event occurred
	 * \param event the event to handle
	 */
	virtual void handleEvent(Generator* generator, EventData*& event) = 0;

protected:
	StateBase(const char* name);

	virtual ~StateBase();

protected:
	char* mName;
};

} // namespace common
} // namespace tsc

#endif // STATE_BASE_H
